export default {
  // 开启命名空间 namespaced
  namespaced: true,
  state: {
    photo: localStorage.getItem('TT_PHOTO') || ''
  },
  mutations: {
    setPhoto (state, payload) {
      // 缓存到内存中
      state.photo = payload
      // 存到硬盘中(本地存储)===>本地持久化(不然切换没有此方法的页面,刷新了值就没了)
      localStorage.setItem('TT_PHOTO', payload)
    }
  }

}
